<div class="refentry" lang="en" xml:lang="en"><a id="glPointSize"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glPointSize — specify the diameter of rasterized points</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">glPointSize</b>(</code></td><td>GLfloat  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
                    Specifies the diameter of rasterized points.
                    The initial value is 1.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glPointSize</code> specifies the rasterized diameter of both aliased and antialiased
            points.  Using a point size other than 1 has different effects, depending
            on whether point antialiasing is enabled.  To enable and disable point
            antialiasing, call <a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument
            <code class="constant">GL_POINT_SMOOTH</code>. Point antialiasing is initially disabled.
        </p><p>
            The specified point size is multiplied with a distance attenuation factor
            and clamped to the specified point size range, and further clamped to the
            implementation-dependent point size range to produce the derived point size
            using
        </p><p>
            </p><div class="informalequation"><math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">pointSize</mi>
                    <mo>=</mo>
                    <mrow>
                        <mi mathvariant="italic">clamp</mi>
                        <mo>⁢</mo>
                        <mfenced open="(" close=")">
                            <mrow>
                                <mi mathvariant="italic">size</mi>
                                <mo>×</mo>
                                <msqrt>
                                    <mfenced open="" close="">
                                        <mfenced open="(" close=")">
                                            <mfrac>
                                                <mn>1</mn>
                                                <mfenced open="" close="">
                                                    <mrow>
                                                        <mi mathvariant="italic">a</mi>
                                                        <mo>+</mo>
                                                        <mrow>
                                                            <mi mathvariant="italic">b</mi>
                                                            <mo>×</mo>
                                                            <mi mathvariant="italic">d</mi>
                                                        </mrow>
                                                        <mo>+</mo>
                                                        <mrow>
                                                            <mi mathvariant="italic">c</mi>
                                                            <mo>×</mo>
                                                            <mfenced open="" close="">
                                                                <msup><mi mathvariant="italic">d</mi>
                                                                <mn>2</mn>
                                                                </msup>
                                                            </mfenced>
                                                        </mrow>
                                                    </mrow>
                                                </mfenced>
                                            </mfrac>
                                        </mfenced>
                                    </mfenced>
                                </msqrt>
                            </mrow>
                        </mfenced>
                    </mrow>
                </mrow>
            </math></div><p>
        </p><p>
            where
            <math overflow="scroll"><mi mathvariant="italic">d</mi></math>
            is the eye-coordinate distance from the eye to the vertex, and
            <math overflow="scroll"><mi mathvariant="italic">a</mi></math>,
            <math overflow="scroll"><mi mathvariant="italic">b</mi></math>,
            and
            <math overflow="scroll"><mi mathvariant="italic">c</mi></math>
            are the distance attenuation coefficients (see
            <a class="citerefentry" href="glPointParameter"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>).
        </p><p>
            If multisampling is disabled, the computed point size is used as the
            point's width.
        </p><p>
            If multisampling is enabled, the point may be faded by modifying the point
            alpha value (see <a class="citerefentry" href="glSampleCoverage"><span class="citerefentry"><span class="refentrytitle">glSampleCoverage</span></span></a>) instead of allowing the point width
            to go below a given threshold (see <a class="citerefentry" href="glPointParameter"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>).  In this case,
            the width is further modified in the following manner:
        </p><p>
            </p><div class="informalequation"><math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">pointWidth</mi>
                    <mo>=</mo>
                    <mfenced open="{" close="">
                        <mrow>
                            <mtable>
                                <mtr><mtd>
                                    <mi mathvariant="italic">pointSize</mi>
                                </mtd></mtr>
                                <mtr><mtd>
                                    <mi mathvariant="italic">threshold</mi>
                                </mtd></mtr>
                            </mtable>
                            <mo>⁢</mo>
                            <mtable>
                                <mtr><mtd>
                                    <mrow>
                                        <mi mathvariant="italic">pointSize</mi>
                                        <mo>&gt;=</mo>
                                        <mi mathvariant="italic">threshold</mi>
                                    </mrow>
                                </mtd></mtr>
                                <mtr><mtd>
                                    <mi mathvariant="italic">otherwise</mi>
                                </mtd></mtr>
                            </mtable>
                        </mrow>
                    </mfenced>
                </mrow>
            </math></div><p>
        </p><p>
            The point alpha value is modified by computing:
        </p><p>
            </p><div class="informalequation"><math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">pointAlpha</mi>
                    <mo>=</mo>
                    <mfenced open="{" close="">
                        <mrow>
                            <mtable>
                                <mtr><mtd>
                                    <mn>1</mn>
                                </mtd></mtr>
                                <mtr><mtd>
                                    <msup><mfenced open="(" close=")">
                                        <mfrac>
                                            <mi mathvariant="italic">pointSize</mi>
                                            <mi mathvariant="italic">threshold</mi>
                                        </mfrac>
                                    </mfenced>
                                    <mn>2</mn>
                                    </msup>
                                </mtd></mtr>
                            </mtable>
                            <mo>⁢</mo>
                            <mtable>
                                <mtr><mtd>
                                    <mrow>
                                        <mi mathvariant="italic">pointSize</mi>
                                        <mo>&gt;=</mo>
                                        <mi mathvariant="italic">threshold</mi>
                                    </mrow>
                                </mtd></mtr>
                                <mtr><mtd>
                                    <mi mathvariant="italic">otherwise</mi>
                                </mtd></mtr>
                            </mtable>
                        </mrow>
                    </mfenced>
                </mrow>
            </math></div><p>
        </p><p>
            If point antialiasing is disabled, the actual size is determined by
            rounding the supplied size to the nearest integer.  (If the rounding
            results in the value 0, it is as if the point size were 1.)  If the rounded
            size is odd, then the center point
            (<math overflow="scroll">

                <mi mathvariant="italic">x</mi>
            </math>,
            <math overflow="scroll">

                <mi mathvariant="italic">y</mi>
            </math>)
            of the pixel fragment
            that represents the point is computed as
        </p><p>
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <mrow>
                        <mfenced open="&#x230A;" close="&#x230B;">
                            <msub><mi mathvariant="italic">x</mi>
                            <mi mathvariant="italic">w</mi>
                            </msub>
                        </mfenced>
                        <mo>+</mo>
                        <mn>.5</mn>
                    </mrow>
                    <mrow>
                        <mfenced open="&#x230A;" close="&#x230B;">
                            <msub><mi mathvariant="italic">y</mi>
                            <mi mathvariant="italic">w</mi>
                            </msub>
                        </mfenced>
                        <mo>+</mo>
                        <mn>.5</mn>
                    </mrow>
                </mfenced>
            </math>
        </p><p>
            where
            <math overflow="scroll"><mi mathvariant="italic">w</mi></math>
            subscripts indicate window coordinates.  All pixels that lie
            within the square grid of the rounded size centered at
            (<math overflow="scroll">

                <mi mathvariant="italic">x</mi>
            </math>,
            <math overflow="scroll">

                <mi mathvariant="italic">y</mi>
            </math>)
            make
            up the fragment.  If the size is even, the center point is
        </p><p>
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <mfenced open="&#x230A;" close="&#x230B;">
                        <mrow>
                            <msub><mi mathvariant="italic">x</mi>
                            <mi mathvariant="italic">w</mi>
                            </msub>
                            <mo>+</mo>
                            <mn>.5</mn>
                        </mrow>
                    </mfenced>
                    <mfenced open="&#x230A;" close="&#x230B;">
                        <mrow>
                            <msub><mi mathvariant="italic">y</mi>
                            <mi mathvariant="italic">w</mi>
                            </msub>
                            <mo>+</mo>
                            <mn>.5</mn>
                        </mrow>
                    </mfenced>
                </mfenced>
            </math>
        </p><p>
            and the rasterized fragment's centers are the half-integer window
            coordinates within the square of the rounded size centered at
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <mi mathvariant="italic">x</mi>
                    <mi mathvariant="italic">y</mi>
                </mfenced>
            </math>.
            All pixel fragments produced in rasterizing a nonantialiased point are
            assigned the same associated data, that of the vertex corresponding to the
            point.
        </p><p>
            If antialiasing is enabled, then point rasterization produces a fragment
            for each pixel square that intersects the region lying within the circle
            having diameter equal to the current point size and centered at the point's
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">x</mi>
                    <mi mathvariant="italic">w</mi>
                    </msub>
                    <msub><mi mathvariant="italic">y</mi>
                    <mi mathvariant="italic">w</mi>
                    </msub>
                </mfenced>
            </math>.
            The coverage value for each fragment is the
            window coordinate area of the intersection of the circular region with the
            corresponding pixel square.  This value is saved and used in the final
            rasterization step.  The data associated with each fragment is the data
            associated with the point being rasterized.
        </p><p>
            Not all sizes are supported when point antialiasing is enabled.  If an
            unsupported size is requested, the nearest supported size is used.  Only
            size 1 is guaranteed to be supported; others depend on the implementation.
            To query the range of supported sizes and the size difference between
            supported sizes within the range, call <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with arguments
            <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>.
            For aliased points, query the supported ranges and granularity with
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with arguments <code class="constant">GL_ALIASED_POINT_SIZE_RANGE</code>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            The point size specified by <code class="function">glPointSize</code> is always returned when
            <code class="constant">GL_POINT_SIZE</code> is queried.  Clamping and rounding for aliased and
            antialiased points have no effect on the specified value.
        </p><p>
            A non-antialiased point size may be clamped to an implementation-dependent
            maximum.  Although this maximum cannot be queried, it must be no less than
            the maximum value for antialiased points, rounded to the nearest integer
            value.
        </p><p>
            <code class="constant">GL_POINT_SIZE_RANGE</code> and <code class="constant">GL_POINT_SIZE_GRANULARITY</code> are
            deprecated in GL versions 1.2 and greater.  Their functionality has been
            replaced by <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and
            <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>size</code></em> is less than or equal to 0.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glPointSize</code>
            is executed between the execution of <a class="citerefentry" href="glBegin"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <a class="citerefentry" href="glEnd"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ALIASED_POINT_SIZE_RANGE</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE_MIN</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE_MAX</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_FADE_THRESHOLD_SIZE</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_DISTANCE_ATTENUATION</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>
        </p><p>
            <a class="citerefentry" href="glIsEnabled"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_POINT_SMOOTH</code>
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
            <a class="citerefentry" href="glPointParameter"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/" target="_top">https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
